/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hcsc.datapower.CMDB.daoImpl;
import com.hcsc.datapower.CMDB.dao.AbstractDao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author I307211
 */
public class UtilDaoImpl extends AbstractDao {
    
    private static final String TABLE = "Platforms";

    /*
     * Retrieves platforms(environments)
     */
    public List<String> getPlatforms(){
        
        String sql = "SELECT * FROM " + TABLE ;
        List<String> tmp = this.jdbcTemplate.query(sql, 
                new RowMapper(){
                    @Override
                    public Object mapRow(ResultSet rs, int i) throws SQLException {
                        return new String(rs.getString("Platform"));
                    }   
                }     
        );
        return tmp;
    }
}